/*
 * @Author: xuetao 3168581151@qq.com
 * @Date: 2025-02-27
 * @LastEditors: xuetao 3168581151@qq.com
 * @LastEditTime: 2025-03-10
 * @Description: 
 */

import 'package:flutter/material.dart';

// 路由
import 'package:chat_client/router/router.dart';
// 仓库
import 'package:chat_client/models/apply_model.dart';
import 'package:chat_client/models/user_model.dart';
import 'package:chat_client/models/contact_model.dart';
// 服务
import 'package:chat_client/services/user_service.dart';
import 'package:chat_client/services/contact_service.dart';
// 组件
import 'package:chat_client/widgets/c_loading.dart';
import 'package:chat_client/widgets/c_input_dialog.dart';
//工具
import 'package:chat_client/utils/current_limiting.dart';
import 'package:chat_client/utils/show_messae.dart';
// 枚举
import 'package:chat_client/screens/mobile/menu/aplly_list.dart';
import 'package:chat_client/screens/mobile/menu/send_allpy_page.dart';

import 'package:chat_client/models/contact_model.dart';
import 'package:chat_client/services/contact_service.dart';
import 'package:chat_client/screens/mobile/contact/contact_page.dart';

class GroupProvider extends ChangeNotifier {
  final ContactService _contactService = ContactService.instance;

  List<Contact> _contactList = [];

  List<Contact> get contactList => _contactList;

  GroupProvider() {
    _contactList = _contactService.getLocalContactList();
  }

  // 备注好友
  Future<void> remarkUser() async {}

  // 解除拉黑
  Future<void> unBlockUser() async {}

  // 拉黑
  Future<void> blockUser() async {}

  // 删除
  Future<void> deleteFriend() async {}

  navToContactPage(contact) {
    RouteManager.navigateToWidget(ContactScreen(contact: contact));
  }

  // 刷新好友列表
  reLoadContactList() {
    _contactList = _contactService.getLocalContactList();
    notifyListeners();
  }

  //
  navToWidget(Widget page) {
    RouteManager.navigateToWidget(page);
  }

  navBack() {
    RouteManager.goBack();
  }

  ///
  refreshContacts() {
    _contactList = _contactService.getLocalContactList();
    notifyListeners();
  }
}
